package com.bst.etl.datax.tool.meta;


import com.bst.common.enums.DataSourceTypeEnum;

/**
 * meta信息工厂
 *
 * @author zhouhongfa@gz-yibo.com
 * @ClassName DatabaseMetaFactory
 * @Version 1.0
 * @since 2019/7/17 15:55
 */
public class DatabaseMetaFactory {

    //根据数据库类型返回对应的接口
    public static DatabaseInterface getByDbType(String dbType) {
        dbType = dbType.toUpperCase();
        if (DataSourceTypeEnum.MYSQL.equals(dbType)) {
            return MySQLDatabaseMeta.getInstance();
        } else if (DataSourceTypeEnum.ORACLE.equals(dbType)) {
            return OracleDatabaseMeta.getInstance();
        } else if (DataSourceTypeEnum.SQLSERVER.equals(dbType)) {
            return SqlServerDatabaseMeta.getInstance();
        } else {
            return MySQLDatabaseMeta.getInstance();
        }
    }
}
